import model from './index'
const BASEURL = 'https://cnodejs.org/api/v1'
class getModel extends model {
  constructor(BASEURL) {
    super()
  }
  // Cnode社区
  getTip(options = {}) {
    options.domain = BASEURL
    options.url = `/topics?tab=${options.tab}&limit=${options.limit}&page=${options.page}&mdrender=${options.mdrender}`
    return this.get(options)
  }
  //主题详情
  getDetail(options = {}) {
    options.domain = BASEURL
    options.url = `/topic/${options.id}`
    return this.get(options)
  }
  //新增主题
  insertColumn(options = {}) {
    options.domain = BASEURL
    options.url = `/topics`
    return this.post(options)
  }
  //编辑主题
  editColumn(options = {}) {
    options.domain = BASEURL
    options.url = `/topics/update`
    return this.post(options)
  }
  //删除主题
  deleteColumn(options = {}) {
    options.domain = BASEURL
    options.url = `/topic_collect/de_collect`
    return this.post(options)
  }
  //获取个人详情
  getUserDetail(options = {}) {
    options.domain = BASEURL
    options.url = `/user/${options.username}`
    return this.get(options)
  }
}
export default getModel